#include "stdio.h"
#include "string.h"
#include "math.h"

main()
{
	int tt[1002],i,j,tot,k,num,x,y,outn;
	char b;
	int n,c;
	tt[1]=1;
	tt[2]=2;
	tot=2;
	for (i=3;i<=1000;++i)
	{
		b=1;
		for (j=2;j<=(i-1);++j)
		{
			if ((i%j)==0) 
			{
				b=0;
				break;
			}	
		}
		if (b==1)
		{
			tt[++tot]=i;
		}
	}	
	while (scanf("%d%d",&n,&c)!=EOF)
	{
		printf("%d %d:",n,c);
		k=tot;
		while (tt[k]>n) --k;
		if (k%2==1) num=c*2-1;
		else num=c*2;
		if (num>=k) 
		{
			for (i=1;i<=k;++i) printf(" %d",tt[i]);
		}else
		{
			x=(k-num)/2+1;
			y=x+num-1;
			for (i=x;i<=y;++i) printf(" %d",tt[i]);	
		}	
		printf("\n");	
		printf("\n");
	}	
	
}

